Repository navigation
TIPS: lessons from signed runs, approved by a person, given to the next session (#859) - #866
Merged
Merged
Conversation
The heading says what Tracekit gives, and the paragraph says who signs the log: a process the agent can't touch. Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
…xt session (#859) Coding agents relearn the same things every session. The signed records already show it across sessions; TIPS now proposes them as lessons, a person approves each one, and the Claude Code hook gives them to the next session at its first prompt. - tracekit/lessons.py (new): three detectors over runs that verify, each run joined to its Claude Code session and project by tool_use id in the transcripts: lookup (the same search, then the same file read within 3 calls, in 3 sessions on 2 days), fix (the same shell failure, then a change of at most 4 words that worked, 3 times in 2 sessions, no write, deny or hold between) and told (a standing instruction the person typed, from the hook's trusted observe of the prompt's typed part). A lesson's text is a template over values or the person's sentence, never the agent's. An occurrence is dropped when its decision's signed provenance names a field it uses, its run's index isn't complete, or any decision in the window carried that value from untrusted content. A lesson that rests on a deny or a hold, or talks about holds, approvals or the policy, is shown to the person only. Checks refuse, never cut: 4,096 bytes, hidden characters, secret and bank-number shapes, redacted values, MEMORY.md past 200 lines or 25 KB. - The lessons folder: <dev data dir>/lessons/projects/<project>/, Claude Code auto-memory notes plus MEMORY.md, statuses active, retired, superseded (and pending after restoring a retired proposal), origin you or run, host-only keys, one git commit per action. A folder holding a link is refused whole; a project name that isn't one folder's too. - tracekit tips: LESSONS first (text and --json); approve, retire, restore and add, read only as tips' first word; --for-agent with --prompt, --query, --project and --json. It reads the vault of the dev signer that runs, 1,000 records a read, and never starts or stops one. - Claude Code hook: at the session's first prompt, and again at SessionStart compact or resume, a signed observe (source tracekit:lessons: lesson ids and the block's sha256, never text), then the block as additionalContext (BM25 within 8,000 bytes, 200 lines and 25 KB). TRACEKIT_LESSONS=0 turns it off; any error gives nothing. - TK-D012 denies the agent's own `tracekit tips approve|retire|restore|add` (coding pack v2-84); E17 and E21 re-recorded (only the policy hashes moved; E21's latency rows kept as main's). - The TIPS page: WAITING FOR YOUR OK (evidence with OPEN to each signed record, the saving as an estimate, the commands to copy), IN USE with the effect (before vs the sessions the signed record proves were given it, from 5 sessions a side), NOT PROPOSED with reasons, WHAT THE NEXT SESSION READS. - Fixed on the way: the transcripts' project is read under the real root (through a linked /tmp it was `..`). - Docs: viewer (Lessons, tracekit tips), coding agents, privacy, limits; AGENTS.md (1.6, tips.py and lessons.py rows). Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
- A lookup's scan stops at a read the policy denied or held: a read of a look-alike that ran after it is no lookup. The dead check in propose goes; nothing rests on a deny or hold by construction. - A FIX lesson names only validated values, never a command, comment or error line: one plain shell call (no quotes, pipes, redirects, expansions or comments), an error from a fixed list (no module named X, X not installed, a missing file, refused access) with only its name kept, and the change as another program, a flag, a setting or `cd DIR`. Texts come from a lesson's key alone, with no counts. - A lesson's id covers its exact text, and approve refuses any other text, so what a person read is what is written. - The evasion word check: a hyphen breaks words, and a person's OK, approval, permission, sign-off, confirming and asking first count. - Every person's answer (approve, retire, restore, add) is first a signed observe on the dev signer that runs (source tracekit:lessons:person: the action, the id and the text's sha256, never the text), which the note names; with no signer running nothing is written. The hook gives only lessons that name one; the page checks the record (signed, changed, not read, none). - A tampered folder: git runs with no hooks, HEAD is accepted only as 40 hex digits, only ids that are ids reach the observe or the measurement, a .git that is a link is refused, and a note past 4,096 bytes is refused without being read whole. - TOLD reads only the Claude Code hook's own claude-code:UserPromptSubmit observe; a limits row says dev mode can forge it. - The hook imports lessons only when it gives them; a test that a failed observe gives no block. Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
- A FIX names only names: each value it names (the program, the error's name, the change) is split at spaces and _ . - = / and dropped past 5 words or 64 characters, or with a standing-instruction marker or the evasion gate's words, so words joined into one flag, folder, setting or error name no longer make a waiting lesson. - The Claude Code hook records a prompt its payload says came through the SDK (source sdk) as claude-code:sdk:UserPromptSubmit, so TOLD, which reads only claude-code:UserPromptSubmit, never takes it as typed. - The hook and tracekit tips --for-agent read each lesson's named record back from the dev signer (content_get) and give a lesson only when it holds the person's answer for that id and text; past the dev signer's 7 days of kept content, only the run's existence (lean:). The TIPS page says "unknown" in the warning colour for a note naming a run the store doesn't hold; tracekit tips signs one command's answers in one run. - A hand-written note shows no "approved None"; an effect's reason no longer ends in two periods. Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
- A person's answers outlive the vault's retention: the signer keeps the content of a run holding nothing but tracekit:lessons:person observes (expire_content), and refuses any such observe whose value isn't an action, a lesson's id and a sha256. lessons.verified no longer takes an erased run on its existence: the check is always the record's action, id and hash, so a changed text, another id naming a real answer, and a made-up seq of an old run are refused after erasure too. - A FIX names only what the session's signed records show: a folder or a swapped-in program only when relative, with no "..", and named by an earlier signed read of the session; a flag only when the fix removed it; a setting by its name, never its value; an error's name only when a signed call or read of the session holds it. - Python 3.9: a starred expression in a subscript (3.11 syntax) is now a parenthesized tuple; every tracked .py file compiles on 3.9, and the affected tests pass on 3.9. Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
- The retention skip is bounded: only the dev signer (isolation same-user), where lessons live, keeps a run of a person's answers past retention; a run of more than 64 answers is erased as any other; and a closed run's keep-or-erase verdict is kept, so it is read once. - A tracekit:lessons:person observe whose action, id or sha256 isn't a string (a list, a dict) is refused as invalid_request instead of crashing the call; the signer stays up. - A limits row: a FIX lesson can name a folder, program or module the agent named itself (a name of at most 5 words and 64 characters, never a sentence); the person's approval is the gate. Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
- The paths a FIX reads (a read's paths, a folder or program it names) are the shell's words, normalised with posixpath on every OS: on Windows os.path.normpath made `site/conf.py` into `site\conf.py`, and the folder it named was never found. - The folder's git output is decoded as UTF-8 (errors replaced), not in the locale's encoding. - The tests read and write their notes and MEMORY.md in UTF-8 (cp1252 on Windows broke the em dash), and the CLI tests that need a Unix socket skip without one, as the Command tests do. Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
…the lessons part Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
…n init's settings alone content_get now says each record's type and an input.observed's source (RPC version 25), and lessons.verified takes only an observe under the person's source: a call's arguments or an observe under another source with the same value are never a person's answer. The lessons folder's git runs only on the settings git init writes: a planted core.fsmonitor, filter, include or .gitattributes keeps the change out of its history, and the person is told so. Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
… the lessons ones, coding pack v2-85 Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
10 of 11 tasks
Seyamalam
added a commit
to Seyamalam/Tracekit
that referenced
this pull request
Nov 16, 2026
…nded, take v2-86) Cygnux-Labs#866 took 2026.11-v2-85; bump the pack to 2026.11-v2-86 and re-record E17 and E21 against the merged packs. eval/results conflicts resolved by regenerating; e21_policy_robustness machine/latency kept at the recorded reference. Signed-off-by: Seyamalam <seyamalam41@gmail.com>
LoopGlitch26
added a commit
to wanjinhao1/Tracekit
that referenced
this pull request
Nov 17, 2026
Conflicts with the TIPS lessons (Cygnux-Labs#866): build() and Page take folder, known and codex; the sources keep both codex and lessons; tracekit tips and the viewer pass all three; the page's READ line keeps Codex's line and the lessons; docs/viewer.md's tracekit tips paragraph names both. Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
This was referenced Nov 17, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #859
What it does
Coding agents relearn the same things every session. The signed records already show it, across sessions. TIPS now
has a LESSONS part (
tracekit tipsand the TIPS page oftracekit view): it finds what the agents kept relearning,a person approves each one, and the Claude Code hook gives the approved ones to the next session at its first prompt,
after signing which ones it gave.
tracekit/lessons.py, new), from runs that verify, each runjoined to its Claude Code session and project by tool_use id in the transcripts:
lookup: the same search (Grep, Glob, WebSearch, or a shellrg/grep -r/git grep/find -name), then the samefile read within 3 calls, in 3 sessions on 2 days; a file written, or a call denied or held, in between makes it none.
fix: the same plain shell call (no quotes, pipes, redirects, expansions or comments) failing with one of fourerrors (no module named X, X not installed, a missing file, refused access; only the name X is kept), then the same
call with another program or
cd DIRfirst (a relative path, no.., that an earlier signed read of the sessionnamed), a flag removed, or a setting added (by its name, never its value), that worked, 3 times in 2 sessions; the
error's name must be in a signed call or read of the session. A flag the fix added, a write, a deny or a hold in
between makes it none, and so does a value it names that reads as words: split at spaces and
_ . - = /, past 5words or 64 characters, or with a standing-instruction marker or the evasion gate's words.
told: a standing instruction the person typed ("from now on", "always", "never", ...), from the Claude Code hook'sown trusted
claude-code:UserPromptSubmitobserve of the prompt's typed part, never a paste, harness text, aprompt Claude Code says came through its SDK (now recorded as
claude-code:sdk:UserPromptSubmit) or anothersource.
a setting, an error's name), or the person's sentence: never a command, a comment or an error line. An occurrence is
dropped when
its decision's signed
provenancenames a field it uses, its run's provenance index isn't complete (provenance_stateis absent only when complete with nothing untrusted: checked in
signer/service.py_provenance), or anydecision in the window carried that value from untrusted content (a page fetched in another session, a memory note
written from one). Nothing rests on a deny or a hold (detection stops there), and a lesson whose words talk about
holds, approvals, permission, a sign-off, confirming or asking first, or the policy (a hyphen breaks words) is shown
to the person only.
tracekit tips approve|retire|restore ID,tracekit tips add TEXT. A lesson's idcovers its exact text, and approve refuses any other, so the text approved is the text read. Each answer is first a
signed observe on the dev signer that runs (source
tracekit:lessons:person: the action, the id and the text'ssha256, never the text), which the note names; with no signer running nothing is written. Lessons are
Claude Code auto-memory notes with a
MEMORY.mdindex in<dev data dir>/lessons/projects/<project>/, one gitcommit per action (
lean:needs the git binary). Statuses active, retired, superseded; origin you or run; host-onlykeys (
id,kind,key,evidence,tier,approved,before,signed, plus the status keys). Checks refuse,never cut: 4,096 bytes (on read too), hidden characters, secret and bank-number shapes, redacted values,
MEMORY.mdpast 200 lines or 25 KB. A folder (or its
.git) holding a link is refused whole; its git runs with no hooks; only a40-hex HEAD and
L-[0-9a-f]{8}ids reach a signed record. Proposals are computed, never stored; 8 shown per project.UserPromptSubmit(again atSessionStartcompact/resume), BM25 againstthe typed prompt within 8,000 bytes and a 200-line / 25 KB index; before printing, a signed observe, source
tracekit:lessons, value{commit, whole, lines, left_out, sha256}: ids and a hash, never text, so a lesson neverwidens what the provenance index trusts. A lesson is given only when the record its note names, read back from the
dev signer (
content_get), holds the person's approve, restore or add of that id and text (the signer keeps a runof answers alone past its retention, so old lessons are checked the same way); the page checks the record itself (signed, changed,
outside the window, a run the store doesn't hold, or none).
TRACEKIT_LESSONS=0turns it off; any error, a failedobserve included, gives nothing.
tracekit tips --for-agent [--prompt|--query] [--json]reads the folder and asks thedev signer that runs the same way (none is given while none runs).
TK-D012denies the agent's owntracekit tips approve|retire|restore|add(read only as tips' first word, theonly place the command takes one; coding pack v2-84).
14 days, shown from 5 sessions a side ("3 of 5 sessions so far"), a worse after in the warning colour, labelled
"before and after on the same detector, not a controlled test".
What a user sees
Before:
tracekit tipsand the TIPS page showed three cost tips. After (a scratch store made by three Claude Codesessions through the real hook, then
tracekit tips):After
tracekit tips approve L-fd9a655a L-22260269(each answer a signedtracekit:lessons:personrecord, shown as"Approved by a person: signed (run …, record 1)"), a new session's first prompt through the hook printed
{"hookSpecificOutput": {"hookEventName": "UserPromptSubmit", "additionalContext": "Lessons from this project's signed runs, approved by the person (Tracekit). ..."}}, and its run held, right after the prompt's record, aninput.observedtracekit:lessons(trusted) whose kept value was{"commit": "c2dbee7…", "whole": ["L-fd9a655a", "L-22260269"], "lines": [], "left_out": [], "sha256": "f0906ed…"};the hash equals the printed block's. The same session's
tracekit tips approve L-e24bb871through the hook:BLOCKED … (TK-D012);tracekit tips --for-agent --query pytest: allowed.Fail-first and mutation checks
Each mutation removes one guarantee; its test fails with it and passes without (70, all caught). The W rows are round
6's (Windows), the C3 rows round 5's items, the A2/C2 rows round 4's, the other lettered rows round 3's, the numbered rows round 2's:
test_the_paths_a_fix_names_read_the_same_on_windowstest_the_paths_a_fix_names_read_the_same_on_windowstest_only_the_dev_signer_keeps_a_run_of_answers_at_most_64_each_read_oncetest_only_the_dev_signer_keeps_a_run_of_answers_at_most_64_each_read_oncetest_only_the_dev_signer_keeps_a_run_of_answers_at_most_64_each_read_oncetest_a_persons_answers_outlive_the_vaults_retention_and_nothing_else_doestest_a_fix_names_only_what_the_sessions_signed_records_showtest_a_fix_names_only_what_the_sessions_signed_records_showtest_a_fix_names_only_what_the_sessions_signed_records_showtest_a_fix_names_only_what_the_sessions_signed_records_showtest_a_fix_names_only_what_the_sessions_signed_records_showtest_a_fix_names_only_what_the_sessions_signed_records_showtest_a_fix_names_only_what_the_sessions_signed_records_showtest_a_fix_names_only_what_the_sessions_signed_records_showtest_a_fix_names_only_what_the_sessions_signed_records_showtest_a_persons_answers_outlive_the_vaults_retention_and_nothing_else_doestest_a_persons_answers_outlive_the_vaults_retention_and_nothing_else_doestest_a_persons_answers_outlive_the_vaults_retention_and_nothing_else_doestest_a_persons_answers_outlive_the_vaults_retention_and_nothing_else_doestest_words_riding_inside_one_value_make_no_fixtest_words_riding_inside_one_value_make_no_fixtest_words_riding_inside_one_value_make_no_fixtest_words_riding_inside_one_value_make_no_fixtest_words_riding_inside_one_value_make_no_fixtest_words_riding_inside_one_value_make_no_fixtest_words_riding_inside_one_value_make_no_fixtest_a_turn_claude_code_says_no_person_typed_is_untrusted_and_states_nothing_livetest_a_note_naming_a_record_the_signer_does_not_hold_as_its_answer_is_never_giventest_the_hook_gives_only_notes_whose_named_record_holds_their_answertest_the_hook_gives_only_notes_whose_named_record_holds_their_answertest_the_hook_gives_only_notes_whose_named_record_holds_their_answertest_a_lesson_in_use_shows_whether_the_signed_record_of_its_answer_names_its_texttest_a_lesson_in_use_shows_whether_the_signed_record_of_its_answer_names_its_texttest_the_viewer_knows_every_run_of_its_store_not_only_those_it_checkedtest_approve_retire_restore_add_and_for_agenttest_approve_retire_restore_add_and_for_agenttest_approve_retire_restore_add_and_for_agenttest_approve_retire_restore_add_and_for_agenttest_an_effect_waits_for_five_sessions_and_a_worse_one_is_in_the_warning_colourtest_an_effect_waits_for_five_sessions_and_a_worse_one_is_in_the_warning_colourtest_a_read_after_a_denied_or_held_read_is_no_lookuptest_no_command_comment_or_error_line_reaches_a_lessons_texttest_no_command_comment_or_error_line_reaches_a_lessons_texttest_approve_writes_only_the_text_its_id_namestest_approve_writes_only_the_text_its_id_namestest_hyphens_break_words_and_a_persons_ok_is_one_of_themtest_hyphens_break_words_and_a_persons_ok_is_one_of_themtest_each_answer_is_signed_after_its_checks_and_before_it_is_writtentest_a_note_without_its_signed_record_is_never_giventest_a_lesson_in_use_shows_whether_the_signed_record_of_its_answer_names_its_texttest_a_tampered_folder_runs_no_hook_and_gives_no_planted_valuetest_a_tampered_folder_runs_no_hook_and_gives_no_planted_valuetest_a_tampered_folder_runs_no_hook_and_gives_no_planted_valuetest_a_tampered_folder_runs_no_hook_and_gives_no_planted_valuetest_a_tampered_folder_runs_no_hook_and_gives_no_planted_valuetest_a_session_given_lessons_counts_before_its_first_calltest_only_the_claude_code_hooks_own_typed_prompt_is_toldtest_no_block_without_its_signed_observetest_a_path_only_a_fetched_page_brought_is_tainted_and_never_proposedtest_a_run_whose_provenance_is_not_complete_gives_no_occurrencetest_a_value_untrusted_content_brought_in_another_session_taints_it_everywheretest_a_tainted_candidate_is_named_only_when_taint_is_what_stopped_ittest_a_told_lesson_about_holds_is_shown_to_the_person_onlytest_a_deny_or_hold_then_a_rewrite_teaches_nothingtest_over_4096_bytes_invisible_or_secret_is_refused_not_cuttest_a_project_name_that_is_not_one_folder_is_refusedtest_a_session_given_lessons_counts_before_its_first_calltest_the_first_prompt_gets_the_block_and_a_signed_observe_names_its_idstest_reading_the_tips_never_starts_or_stops_a_signertest_the_agents_own_tracekit_tips_approve_is_denied_and_for_agent_is_notAlso fail-first:
test_each_call_names_its_project_folder_through_a_linked_root(the transcripts' project read as..through macOS's linked
/tmp, found while testing like a user).Gates
PATH=<repo>/.venv/bin:$PATH PYTHONPATH=$PWD make test-ts lint build test PY=<repo>/.venv/bin/pythonin theworktree, on the final tree (round 5): lint clean; build and twine check passed; TypeScript 161 passed, 0 failed, 12 skipped (173); pytest 5,377 passed, 447 skipped, 10 xfailed, 75,070 subtests passed in 32 min 53 s, nothing failed; every tracked .py file compiles on Python 3.9.25, and the tips, lessons and content vault tests pass on it (140 passed). Policy evals re-run for the pack change in round 1 (the
repo's convention): E17 policy corpus (all harmful stopped, benign FP 0.11%, no decision changed), E21 policy
robustness and E21 robustness: only the policy hashes moved; E21's latency rows kept as main's.
Real week (this machine, read-only, through
tracekit tips)Read-only, through
tracekit tipsitself: 32 runs, 152,340 signed records, 291 Claude Code transcripts, 2 min 44 s.talks about holds). By my reading about 5 of the 8 are real standing rules and 3 are conversational uses of
"always": the marker list is a first guess, and a person approves each one.
taint was applied, and 131 occurrences were tainted (of the first 40 listed: 18 because their run's provenance index
was
unavailable, after a signer restart; most others a URL a WebFetch or WebSearch brought). Each worktree is itsown Claude Code project folder, which splits repeats.
content.accessedrecords at 1,000records a read (it was about 1,240 at the viewer's 100 a read, so
tracekit tipsnow asks for 1,000).machine's older running dev signer and started this branch's.
tracekit tipsnow reads only the vault of the devsigner that runs and never starts, stops or replaces one (regression test above).
Limits rows (docs/limits.md, Viewer)
the 7-day window and one Claude Code project; a fix only in one plain shell call, one of four errors and one of four
kinds of change (a folder or program a relative path an earlier signed read named, a flag removed, a setting's
name), the error's name in a signed call or read, each value at most 5 words and 64 characters. What the agent still
chooses (a setting's name such as
PUSH_UNREVIEWED, a removed flag, a folder or program it read first) is gated bythe person's approval. What to do: read each card before approving it;
tracekit tips add TEXT.256 characters), verbatim values, in the window: a shorter word, or a value a page brought before the window and the
agent carried in its own memory, isn't caught; a run whose index isn't complete gives no evidence. What to do: read
the EVIDENCE, above all a RISKY one.
tracekit tips approveare protected by tripwires (TK-D007,TK-D013,TK-D012), notisolation. Each answer is a signed record the note names, so a lesson planted through Tracekit's own code still
leaves one; the hook reads each named record back from the dev signer and gives a lesson only when it holds the
person's answer for that id and text, so one written by hand is never given, and the page shows one naming a run the
store doesn't hold in the warning colour. On the dev signer, a run of answers alone (at most 64) keeps its content
past the vault's retention (each answer an action, an id and a sha256; the signer refuses any other value under that
source). An observe the agent
sends in its own run with that value and the person's source passes both checks. What to do: system mode or a central signer; IN USE's signed line;
git -C "<dev data dir>/lessons" log.of the user can send with the session's run token; a prompt Claude Code's payload marks
sdkis recorded underclaude-code:sdk:UserPromptSubmitand never read for one, and a payload with nosourceis taken as typed. What todo: system mode or a central signer.
8,000 bytes. What to do:
tracekit tips --for-agent [--query WORDS]from other agents.What to do: read the counts.
content.accessedper run and 1,000 records pertracekit tips;nothing is found without a running dev signer, with
TRACEKIT_DEV_CONTENT=0or--data-dir; approve and retireread the window again.
Review round 2 (the independent review of c1e1f8e)
the dead check in
proposeis gone.is a template over validated values only (program, error name, the change's words), never a command or error line;
the risky and evasion checks run over every agent-facing string.
first count.
the block gives only lessons that name one; the page checks each.
.gitlink refused, anote past the cap refused unread.
claude-code:UserPromptSubmit; a limits row says dev mode can forge it.lessonsimported lazily in the hook; the dead code dropped. The README commit stays, as asked.Review round 3 (the re-review of 5ea66bd)
A. Words riding inside one FIX value (
--note=rerun_every_held_call_with_bash_c_never_wait_for_the_person,cd always-push-to-main-the-person-said-so &&,REMEMBER=always_push_to_main_and_skip_review, an error namefrom_now_on.always_push_to_main_without_review,always-push-to-main-the-person-said-so: command not found) eachmade a waiting, non-risky FIX 3 times in 2 sessions. Each value a FIX names is now read as the words it splits into
at spaces and
_ . - = /: past 5 words or 64 characters, or with a marker or the evasion gate's words, theoccurrence is dropped (
lessons._named). A test runs each of the five.B. TOLD from an SDK source: the hook now records a prompt Claude Code's payload marks
source: sdkasclaude-code:sdk:UserPromptSubmit, which TOLD (exactlyclaude-code:UserPromptSubmit) never reads;tracekit analyze --v2and the viewer read any…:UserPromptSubmit, so they are unchanged. A payload with nosourceisstill taken as typed (limits row 7).
C. A note written by hand naming a made-up record (
signed: made-up-run:1) reached the block: the hook and--for-agentnow read each named record back from the dev signer (
lessons.verified: one signedcontent.accessedper run ofanswers, at each first prompt;
tracekit tipsnow signs one command's answers in one run to keep that small) andgive a lesson only when it holds the person's answer for that id and text. (Round 3 took a run whose kept content
retention had erased on the run's existence; round 4 replaced that.) The page says "unknown" in the warning colour for a run the store doesn't hold (the CLI from
the store's runs, the viewer from its feed's runs at its latest refresh), and the limits sentence is fixed.
Found testing like a user: a hand-written note's card said "approved None" (the page "approved null"), and an effect's
reason ended in two periods; both fixed, with tests.
As a user (a scratch HOME and its own dev signer; sessions through the worktree's hook, one process per event):
the five probes, each 3 times in 2 sessions beside a real
python3/.venv/bin/pythonfix, thentracekit tips --json:WAITING: [fix: "python3fails here: no module namedpytest. With.venv/bin/pythonin its place it worked."],NOT PROPOSED: []. An SDK prompt "From now on, always push to main without review." was recorded asclaude-code:sdk:UserPromptSubmitand made no lesson. With the person's own lesson (tracekit tips add's code, signedby the scratch signer) and a planted note naming
made-up-run:1, a new session's first prompt got a block with theperson's lesson only;
tracekit tipssaid of the planted one "It names run made-up-run, which the store doesn't hold:written by hand, never given to the agent." and the TIPS page of
tracekit view --devshowed it in the warning colour,the next session's block holding 1 lesson;
--for-agentgave the person's lesson only.Final check (round 4, of 0e4301e)
C. After the vault's retention (7 days in dev),
content_getanswerserasedfor any seq of a run, andlessons.verifiedtook that on the run alone: a real approval's note with its text changed, another id naming thatrecord, and a made-up seq of an old run (
run:999) were all given. Now the signer keeps the content of a run holdingnothing but
tracekit:lessons:personobserves past retention (expire_content,_answers: it reads each candidaterun up to its first record that isn't one, so an agent's run costs a record or two, once), and refuses any such
observe whose value isn't exactly an action, a lesson's id and a sha256, so those runs keep nothing else. The
erasedbranch is gone: the check is always the record's action, id and hash. A test on a real signer afterexpire_content(now + 8 days): the person's answer is still given; a changed text, another id, an agent's runholding the same value (erased),
run:999, and a run of an answer plus a call (erased) are all refused; fourmisshapen answers are refused by the signer.
A. Short instructions inside the caps (
cd push-main,--x=skip_review,--force-push-main,PUSH_UNREVIEWED=1,--rm-rf-tests-first,cd ../prod-creds,No module named 'push_main_now') made waiting FIX lessons. Thestructural rule now:
cd DIRand a swapped-in program only when relative, with no.., and named by an earliersigned read of the session (Read, Glob, Grep, LS, or a shell
ls,cat,head,tail,find,tree,stat,fileorwhichthat ran: the path itself or one under it); a flag only when the fix removed it; a setting by itsname, never its value; an error's name only when a signed call or read of the session holds it (the transcript's
error text is the agent process's). What is left, a setting's name (
With PUSH_UNREVIEWED set it worked.), aremoved flag, a folder or program the agent read first, is gated by the person's approval (limits row 1). Real cost:
python3→.venv/bin/pythonis learned only when the session read.venv/bin/pythonfirst (ls,which).Python 3.9 (CI's py3.9 jobs failed Lint at 0e4301e):
idx["failed"][c["project"], ..., *failed[:2]], a starredexpression in a subscript, is 3.11 syntax; it is a parenthesized tuple now. With uv's Python 3.9.25 every tracked
.pyfile compiles (476, 0 failed), pyflakes is clean, and the lessons, tips, hook, content vault and view tests pass
(380 passed). No in-suite test can catch it on 3.12+ (
ast.parse(feature_version=(3, 9))accepts that syntax), so thepy3.9 CI job is its check.
As a user (a fresh scratch HOME and its own dev signer, sessions through the worktree's hook): the five round-3 probes
and the seven above, each 3 times in 2 sessions, beside a real fix after
ls .venv/bin/python, thentracekit tips:two waiting, "
python3fails here: no module namedpytest. With.venv/bin/pythonin its place it worked." and"... With
PUSH_UNREVIEWEDset it worked." (the name only, by design); nothing else, not even under NOT PROPOSED. Theplanted note naming
made-up-run:1again stayed out of the first prompt's block and--for-agent. The erasure caseis tested on a real signer service (its sweep with a clock 8 days on), not in the scratch run.
Last check (round 5, of 4f0ff5a)
with no cap, on every signer. Now only the dev signer (isolation
same-user, asopen_devopens it) keeps a run ofanswers; a run of more than 64 answers (
ANSWERS_KEPT;tracekit tipswrites one run per command) is erased asany other; and a closed run's keep-or-erase verdict is cached, so each is read once (later sweeps read only its
first record, as the replay lookup already does for every vault run). Test: on the dev signer a 64-answer run is
kept and a 65-answer run erased; two sweeps read the kept run's records once; a signer that isn't the dev one erases
it as before.
actioncrashed_observe(ina frozenset raised TypeError, and the client saw the connectiondrop). The action is type-checked first, as the id and hash were. Test: a list or dict action, a list id and a dict
sha256 each answer
invalid_request, and a valid answer right after is signed.read; its own call's module; a removed flag; a setting's name), a name of at most 5 words and 64 characters, never
a sentence; the person's approval is the gate.
Windows (round 6, of 6b549ef)
CI's Windows jobs (py3.9, py3.13) failed 5 tests. Three causes:
_read_pathsand_foundnormalised withos.path.normpath, which on Windows makessite/conf.pyintosite\conf.py, so a folder a Read under it named was never found (theIndexError). The paths a FIX reads are theshell's words:
posixpath.normpathon every OS. Test:test_the_paths_a_fix_names_read_the_same_on_windowsrunsdetection with
os.pathset tontpath; it fails on 6b549ef.lessons.pyalready wrote and read notes andMEMORY.mdas UTF-8 bytes; the tests readMEMORY.md(and wrote planted notes) in the locale's encoding, which broke the em dash on cp1252. The tests now say UTF-8, and
the folder's git output is decoded as UTF-8 (errors replaced) instead of the locale's. Simulated here with
LC_ALL=en_US.ISO8859-1 PYTHONUTF8=0:test_approve_writes_the_note_rebuilds_memory_md_and_commitsfails on6b549ef with the same mojibake and passes now; a run with
-X warn_default_encodingfinds no default-encodingopen left in lessons' code or the branch's tests.
socketserverdoesn't have; theLessonsclass now skips withoutAF_UNIX, as theCommandtests already do.Not in this PR
eval/e23_grants.py). Writing the lessons eval (teach, plant,evasion arms on a real in-process signer) was refused by the session's permission classifier; it was not reworded
or handed on (logged). Plant, taint and evasion are covered by
tests/test_lessons.py(synthetic provenance) and the hook andCLI tests on real signers. The owner decides how the eval gets written.
--edit,--all-safe,show, the page-level "since"strip, machine-wide lessons, subagent and other-harness injection.